package com.spring.utils;

import com.mysql.jdbc.Connection;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import javax.sql.DataSource;
import java.sql.SQLException;

@Component
public class ThreddUtis {

    public String getConnection;
    @Autowired
  private DataSource dataSource;

   ThreadLocal<Connection> threadLocal = new ThreadLocal<>();
   public Connection getConnection(){
       Connection connection = threadLocal.get();
       if(connection==null){

       }
       return connection;
   }
   public void removeThread() {threadLocal.remove();}
}
